<% content_for :page_title do %>
Create a stack
<% end %>

<div class='container'>
  <section>
    <header>
      <h1>Create a stack</h1>
    </header>
    <%= form_for @stack do |f| %>
      <fieldset class='form-group'>
        <%= label_tag :stack_repo_owner, 'Repo' %>
        <div class='input-group'>
          <div class='input-group-addon'><%= Shipit.github_url %>/</div>
          <%= f.text_field :repo_owner, placeholder: 'e.g. Shopify', required: true, class: 'form-control' %>
          <div class='input-group-addon'>/</div>
          <%= f.text_field :repo_name, placeholder: 'e.g. shipit-engine', required: true, pattern: "^[a-zA-Z0-9\-_\.]+$", class: 'form-control' %>
        </div>
      </fieldset>
      <fieldset class='form-group'>
        <%= f.label :branch %>
        <%= f.text_field :branch, placeholder: 'master', class: 'form-control' %>
      </fieldset>
      <fieldset class='form-group'>
        <%= f.label :environment %>
        <%= f.text_field :environment, placeholder: 'production', class: 'form-control' %>
      </fieldset>
      <fieldset class='form-group'>
        <%= f.label :deploy_url %>
        <%= f.text_field :deploy_url, placeholder: 'https://', class: 'form-control' %>
        <small class='text-muted'>Where is this stack deployed to?</small>
      </fieldset>
      <fieldset  class='form-group checkbox'>
        <%= label_tag :stack_ignore_ci do %>
          <%= f.check_box :ignore_ci, class: 'checkbox' %>
          Allow deploys regardless of CI status
        <% end %>
      </fieldset>
      <fieldset>
        <%= f.submit class: 'btn btn-primary' %>
      </fieldset>
    <% end %>
  </section>
</div>
